package com.k.ums.controller;

import com.k.ums.model.LoginForm;
import com.k.ums.model.ResponseResult;
import com.k.ums.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * @Description:
 * @Author: kt
 * @CreateTime: 2022/1/27
 */
@Controller
public class LoginController {

    @Resource
    private LoginService loginService;

    @RequestMapping(value = "/login", method = RequestMethod.POST)
    @ResponseBody
    public ResponseResult login(@RequestBody LoginForm loginForm) {
        return ResponseResult.success("success", loginService.login(loginForm));
    }
}
